package org.hzero.order;

import io.choerodon.resource.annoation.EnableChoerodonResourceServer;
import jdk.internal.org.objectweb.asm.tree.MultiANewArrayInsnNode;
import org.hzero.core.jackson.annotation.EnableObjectMapper;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * @ Description   :  启动类
 * @ Author        :  xiong.yilin@hand-china.com
 * @ CreateDate    :  2019/8/8 10:26
 */

@SpringBootApplication
@EnableChoerodonResourceServer
//表示开启AOP代理自动配置，如果配@EnableAspectJAutoProxy表示使用cglib进行代理对象的生成
//设置@EnableAspectJAutoProxy(exposeProxy=true)表示通过aop框架暴露该代理对象
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
@EnableObjectMapper
//启用feign客户端
@EnableFeignClients("org.hzero.order")
//让注册中心能够发现，扫描到该服务
@EnableDiscoveryClient
//自动扫描组件
@ComponentScan(value = {
        "org.hzero.order.api",
        "org.hzero.order.app",
        "org.hzero.order.config",
        "org.hzero.order.domain",
        "org.hzero.order.infra",
})
public class OrderApplication {
    public static void main(String[] args) {
        SpringApplication.run(OrderApplication.class,args);
    }
}
